package com.itheima.homework;

import java.util.Scanner;

public class Test04 {
    /*
    【编号：804】 键盘录入一个字符串，统计该字符串中大写字母字符，小写字母字符，
                数字字符出现的次数(不考虑其他字符)
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入:");
        String str = sc.next();
        int bigCode = 0;
        int smallCode = 0;
        int numCode = 0;
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) >= 'A' && str.charAt(i) <= 'Z') {
                bigCode++;
            } else if (str.charAt(i) >= 'a' && str.charAt(i) <= 'z') {
                smallCode++;
            } else if (str.charAt(i) >= '0' && str.charAt(i) <= '9') {
                numCode++;
            }
        }
        System.out.println("bigCode = " + bigCode);
        System.out.println("smallCode = " + smallCode);
        System.out.println("numCode = " + numCode);
    }
}
